package com.example.yamba;

import android.content.Context;

import com.sina.weibo.sdk.auth.Oauth2AccessToken;
import com.sina.weibo.sdk.net.WeiboParameters;
import com.sina.weibo.sdk.openapi.StatusesAPI;

/**
 * Created by jagery on 8/25/15.
 */
public class MyStatusesAPI extends StatusesAPI {
    private static final String user_timeline_url = "https://api.weibo.com/2/statuses/home_timeline.json";
    public MyStatusesAPI(Context context, String appKey, Oauth2AccessToken accessToken) {
        super(context, appKey, accessToken);
    }
    public String userTimelineSync(long since_id, long max_id, int count, int page) {
        WeiboParameters params = this.buildTimeLineParamsBase(since_id, max_id, count, page);
        return this.requestSync(user_timeline_url, params, "GET");
    }
    private WeiboParameters buildTimeLineParamsBase(long since_id, long max_id, int count, int page) {
        WeiboParameters params = new WeiboParameters(this.mAppKey);
        params.put("since_id", since_id);
        params.put("max_id", max_id);
        params.put("count", count);
        params.put("page", page);
        params.put("base_app",0);
        params.put("feature",0);
        params.put("trim_user",0);
        return params;
    }
}
